package com.zzxx.wechat.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum LanguageEnum {


    ENGLISH("en", "英语"),

    JAPANESE("jp", "日语"),

    ;


    private String code;

    private String desc;

    public static LanguageEnum of(String code) {
        return Arrays.stream(LanguageEnum.values())
                .filter(x -> x.getCode().equals(code)).findAny()
                .orElse(null);
    }
}
